<% content_for :css do %>
  <%= stylesheet_link_tag 'top_hot_tools','sub_nav_bar','homes_show' %>
<% end %>
<% content_for :javascript do %>
<script type="text/javascript" charset="utf-8">
  function show_or_hide(name)
  {
    $$('div#body div.sub_nav_bar div.item').each( function(item) {
      item.className = 'item';
    });
    $('sub_nav_bar_item_' + name).className = 'h item';
    $$('div#body div#tools div.block').each( function(item) {
      item.className = 'block';
    });
    $(name).className = 'h block';
  }

  function show_or_hide_tool(tool_id)
  {
    $$('div#main div#tools div.block div.b_tool').each( function(tool) {
      tool.hide();
    });
    $('b_tool_' + tool_id).show();
    $$('div#main div#tools div.block div.tools div.tool').each( function(tool) {
      tool.className = 'tool';
    });
    $('s_tool_' + tool_id).className = 'tool h';
  }  
</script>
<% end %>  
<% content_for :level_2_nav_bar do %>
  <%= image_tag 'home/top_bg.jpg', :width => 1000 %>
<% end %>
<div class='line'>  
  <div id="main">
    <div class='head'>
      
    </div>
    <%= render :file => 'homes/_top_hot_tools.html', :locals => { :how_many => 13 } %>
    <div id='sub_body' class='body'>
      <%#*<div>%>
        <%#= image_tag 'home/top_bg.jpg', :width => 1000 %>
      <%#*</div>%>
      
      <div id="micro_blog">
        <iframe width="450" height="300" class="share_self"  frameborder="0" scrolling="no" src="http://service.t.sina.com.cn/widget/WeiboShow.php?width=750&height=300&fansRow=1&ptype=1&speed=100&skin=-1&isTitle=1&noborder=1&isWeibo=1&isFans=0&uid=1865046971&verifier=6d797160&colors=ECECEC,FFFFE3,666666,197325"></iframe>
      </div>
      <div id="mts_feeds">
        <div class='top'>
          <div class='title'>
            新鲜事
          </div>
          <div class='tools'>
            <%= link_to_function image_tag("home/feeds_up.gif"), "stopScroll=1;feeds_up()", :onmouseover => 'stopScroll=1;feeds_up()', :onmouseout => 'stopScroll=0;scrollMe()'   %>
            <%= link_to_function image_tag("home/feeds_down.gif"), "stopScroll=1;feeds_down()", :onmouseover => 'stopScroll=1;feeds_down()', :onmouseout => 'stopScroll=0;scrollMe()'   %>
          </div>
        </div>
        <div id='feeds' class='body' onmouseover='stopScroll=1' onmouseout='stopScroll=0;scrollMe()'>
          <% @feeds.each  do |feed|  %>
          <div class='feed'>
            <%= feed_to_html feed %>
          </div>
          <% end %>
        </div>
      </div>
      <%= render :partial => 'scroll_me.js', :locals => { :id => :feeds } %>
      <div class='sub_nav_bar'>
        <div id='sub_nav_bar_item_news' class='h item'>
          <%= link_to_function "最新出炉", "show_or_hide('news')" %>
          <span>New！</span>
        </div>
        <div id='sub_nav_bar_item_newers' class='item'>
          <%= link_to_function "欢迎新人", "show_or_hide('newers')" %>
          <span>Wel...！</span>
        </div>
        <div id='sub_nav_bar_item_loginers' class='item'>
          <%= link_to_function "老食客", "show_or_hide('loginers')" %>
          <span>Login！</span>
        </div>
        <%#*<div id='sub_nav_bar_item_hots' class='item'>%>
          <%#= link_to_function "最热门", "show_or_hide('hots')" %>
          <%#*<span>Hot！</span>%>
        <%#*</div>%>
        <%#*<div id='sub_nav_bar_item_cares' class='item'>%>
          <%#= link_to_function "最关注", "show_or_hide('cares')" %>
          <%#*<span>Care！</span>%>
        <%#*</div>%>
      </div>
      <div id='tools'>
        <div>
          <div id="news" class='h block'>
            <% @new_tops.each do |tool| %>
            <div>
              <div id="b_tool_<%= tool.id %>"class="b_tool" style="<%= @new_tops.first == tool ?  '':'display:none;' %>">
                <div class="left">        
                  <% link_to tool_url(tool), :target => :_blank do %>
                    <%= tool_logo_image_tag tool, :size => '180x210' %>
                  <% end %>
                </div>
                <div class="center">
                    <div class="line title">
                      <div class="h1"><%= link_to tool.name, tool_url(tool) %><span>(版本：<%= tool.version %>)</span></div>
                    </div>
                    <div class="line">
                      <dl>
                        <dt>分&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;类：</dt><dd><%= tool.tool_type.name %></dd>
                      </dl>
                    </div>
                    <div class="line">
                      <dl>
                        <dt>关&nbsp;&nbsp;键&nbsp;&nbsp;词：</dt><dd><%= tool.key_words %></dd>
                      </dl>
                    </div>
                    <div class="line">
                      <dl>
                        <dt>出炉时间：</dt><dd><%= l tool.released_on %></dd>
                      </dl>
                    </div>
                    <div class="line">
                      <dl>
                        <dt>享&nbsp;&nbsp;用&nbsp;&nbsp;度：</dt>
                        <dd class="using">
                          <b><%= tool.user_tool_settings_count %></b>人正在享用
                        </dd>
                      </dl>
                    </div>
                    <div class="line">
                      <dl>
                        <dt>关&nbsp;&nbsp;注&nbsp;&nbsp;度：</dt>
                        <dd class="care">
                          <b><%= tool.carers_count %></b>人关注过
                        </dd>
                      </dl>
                    </div>
                    <div class="line">
                      <dl>
                        <dt>简&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;介：</dt>
                        <dd class="synopsis">
                          <%= tool.synopsis %>
                        </dd>
                      </dl>
                    </div>
                    <div class="line">
                      <dl>
                        <dt>享用方式：</dt>
                        <dd class="funcs">
                          <%= supports_web( :size => '18x18') if tool.support_web? %>
                          <%= supports_sms(:size => '18x18') if tool.support_sms? %>
                          <%= supports_email(:size => '18x18') if tool.support_email? %>
                        </dd>
                      </dl>
                    </div>
                  </div>
                <div class="right"></div>
              </div>
            </div>
            <% end %>
            <div class="tools">
              <% @new_tops.each do |tool| %>
              <div id="s_tool_<%= tool.id %>" class='tool <%= @new_tops.first == tool ? 'h':'' %>' onmouseover="show_or_hide_tool('<%= tool.id %>')" onmouseout="show_or_hide_tool('<%= tool.id %>')">
                <div class='logo'>
                  <% link_to tool_url(tool), :target => :_blank do %>
                    <%= tool_logo_image_tag tool, :size => '100x120'  %>
                  <% end %>
                </div>
                <div class='name'>
                  <%= link_to_tool tool %>
                </div>
                <div class="funcs">
                  <%= supports_web( :size => '14x14') if tool.support_web? %>
                  <%= supports_sms(:size => '14x14') if tool.support_sms? %>
                  <%= supports_email(:size => '14x14') if tool.support_email? %>
                </div>
                <div class="eating">
                  <%= link_to_enjoy_or_not tool %>
                </div>
              </div>
              <% end %>
            </div>
            <div class="more">
              <%= link_to "更多...", tools_url, :title => '更多吐司' %>
            </div>
          </div>
        </div>
        <div>
          <div id="newers" class='block'>
          <% User.newers.each do |user| %>
            <div class='user'>
              <div class='logo'>
                <%= user_logo_image_tag user, :size => '80x100' %>
              </div>
              <div class='name'>
                <%= link_to truncate(user.nick_name, :length  => 10), tools_url, :title => "【#{user.nick_name}】于#{time_ago_in_words(user.created_at,false)}前加入麦吐司网" %>
              </div>
            </div>
          <% end %>
          </div>
        </div>
        <div>
          <div id="loginers" class='block'>
          <% User.logins.each do |user| %>
            <div class='user'>
              <div class='logo'>
                <%= user_logo_image_tag user, :size => '80x100' %>
              </div>
              <div class='name'>
                <%= link_to truncate(user.nick_name, :length  => 10), tools_url, :title => "【#{user.nick_name}】#{time_ago_in_words(user.login_at,false)}前来过" %>
              </div>
            </div>
          <% end %>
          </div>
        </div>
        <div>
          <div id="hots" class='block'>
            <% 10.times do %>
            <div class='tool'>
              <div class='logo'>
                <% link_to "index" do %>
                  <%= image_tag "rails.png", :size => '100x130' %>
                <% end %>
              </div>
              <div class='name'>
                <%= link_to "天气预报", "index" %>
              </div>
              <div class="funcs">
                <img width="14" height="14" alt="支持网页" src="/images/base/funcs/web.png?1276585381" title="支持网页">
                <img width="14" height="14" alt="支持手机短信" src="/images/base/funcs/sms.png?1276584569" title="支持手机短信">
                <img width="14" height="14" alt="支持电子邮件" src="/images/base/funcs/email.png?1276585335" title="支持电子邮件">
              </div>
              <div class="eating">
                <%= cycle '<a class="eating" href="index">立即享用</a>','<a class="has_eated" href="index">正在享用...</a>' %>                                
              </div>
            </div>
            <% end %>
          </div>
        </div>
        <div>
          <div id="cares" class='block'>
            <% 10.times do %>
            <div class='tool'>
              <div class='logo'>
                <% link_to "index" do %>
                  <%= image_tag "rails.png", :size => '100x130' %>
                <% end %>
              </div>
              <div class='name'>
                <%= link_to "天气预报", "index" %>
              </div>
              <div class="funcs">
                <img width="14" height="14" alt="支持网页" src="/images/base/funcs/web.png?1276585381" title="支持网页">
                <img width="14" height="14" alt="支持手机短信" src="/images/base/funcs/sms.png?1276584569" title="支持手机短信">
                <img width="14" height="14" alt="支持电子邮件" src="/images/base/funcs/email.png?1276585335" title="支持电子邮件">
              </div>
              <div class="eating">
                <%= cycle '<a class="eating" href="index">立即享用</a>','<a class="has_eated" href="index">正在享用...</a>' %>                                
              </div>
            </div>
            <% end %>
          </div>
        </div>
      </div>
    </div>
  </div>
</div>
<%= render :file => 'homes/_guild.html' %>
<% content_for :top_of_about_us do %>
<div id='q_a'>
  <div class="span-4" style="text-align: right;">  
    <%= image_tag 'base/qa.gif', :alt => 'Q&amp;A', :size => '97x36'%>            
  </div>
  <div class="span-4">
    <ul class="l16">
      <li class="title">
        <%= link_to "<b>新手指南</b>", helps_url,:target => :_blank %>
      </li>
      <li>
        <%= link_to "我需要在麦吐司注册吗?", helps_url(:id => 1),:target => :_blank %>
      </li>
      <li>
        <%= link_to "一定要绑定手机号吗?", helps_url(:id => 2),:target => :_blank %>
      </li>
      <li>
        <%= link_to "麦吐司的服务真的免费吗?", helps_url(:id => 3),:target => :_blank %>
      </li>
    </ul>
  </div>
  <div class="span-4">
    <ul class="l16">
      <li class="title">
        <%= link_to "<b>手机相关</b>", helps_url,:target => :_blank %>
      </li>
      <li>
        <%= link_to "为什么要绑定飞信号?", helps_url(:id => 4),:target => :_blank %>
      </li>
      <li>
        <%= link_to "如何开通飞信服务?", helps_url(:id => 5),:target => :_blank %>
      </li>
      <li>
        <%= link_to "短信是免费的吗?", helps_url(:id => 6),:target => :_blank %>
      </li>
    </ul>
  </div>
  <div class="span-4">
    <ul class="l16">
      <li class="title">
        <%= link_to "<b>安全相关</b>", helps_url,:target => :_blank %>
      </li>
      <li>
        <%= link_to "麦吐司上的吐司安全吗?", helps_url(:id => 7),:target => :_blank %>
      </li>
      <li>
        <%= link_to "麦吐司会泄露我的个人信息吗?", helps_url(:id => 8),:target => :_blank %>
      </li>
    </ul>
  </div>
  <div class="span-4 last">
    <ul class="l16">
      <li class="title">
        <%= link_to "<b>其他说明</b>", helps_url,:target => :_blank %>
      </li>
      <li>
        <%= link_to "我可以停止使用部分吐司吗?", helps_url(:id => 9),:target => :_blank %>                        
      </li>
      <li>
        <%= link_to "我可以发布或推荐吐司吗?", helps_url(:id => 10),:target => :_blank %>              
      </li>
    </ul>
  </div>        
</div>
<div id="friend_sites">
  <div class='top_corner'>
    <div class='left'>
    </div>
    <div class='right'>
    </div>
  </div>
  <div class='body'>
    <div class='h'>
      <%= link_to "友情链接", 'http://www.mytusi.com', :target => :_blank %>
    </div>
    <div>
      <%= link_to "360安全中心", 'http://www.360.cn', :target => :_blank %>
    </div>
    <div>
      <%= link_to "中国移动通信", 'http://10086.cn/', :target => :_blank %>
    </div>
    <div>
      <%= link_to "中国天气网", 'http://weather.com.cn/', :target => :_blank %>
    </div>
    <div>
      <%= link_to "爱优游.海南旅游网", 'http://www.iuyoo.net', :target => :_blank %>
    </div>
    <div>
      <%= link_to "酷站目录", "http://www.coodir.com/", :target => :_blank, :title => '免费收录各类优秀网站' %>
    </div>
    <div>
      <%= link_to "艇棒网", "http://www.52yacht.net/", :target => :_blank %>
    </div>
    <div>
      <%= link_to "斌锋小家", "http://www.bfmf.cn/", :target => :_blank %>
    </div>
  </div>
  <div class='bottom_corner'>
    <div class='left'>
    </div>
    <div class='right'>
    </div>
  </div>
</div>
<% end %>